package com.xiaobai.netease_news.model;

import com.android.volley.toolbox.JsonObjectRequest;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/6/24 0024.
 */
public class RadioResponseData {
    private List<Clist> clistList;
    private List<Top> topList;

    public void parseJSON(JSONObject json){
        JSONArray cLists = json.optJSONArray("cList");
        clistList = new ArrayList<Clist>();
        for (int i=0;i<cLists.length();i++){
            JSONObject jsonObject = cLists.optJSONObject(i);
            Clist clist = new Clist();
            clist.parseJSON(jsonObject);
            clistList.add(clist);
        }
        JSONArray tops = json.optJSONArray("top");
        topList = new ArrayList<Top>();
        for (int i=0;i<tops.length();i++){
            JSONObject jsonObject = tops.optJSONObject(i);
            Top top = new Top();
            top.parseJSON(jsonObject);
            topList.add(top);
        }
    }

    public List<Clist> getClistList() {
        return clistList;
    }

    public List<Top> getTopList() {
        return topList;
    }
}
